home *** CD-ROM | disk | FTP | other *** search
/ 8bitfiles.net/archives / archives.tar / archives / compuserve-file-archive / 05 Programming / UWEDGE.DOC < prev    next >
Text File  |  2019-04-13  |  16KB  |  289 lines

  1.  UTILITY WEDGE    (4 APRIL 1985)
  2.  
  3.  Command Summary
  4.  
  5.  *    read disk error channel
  6.  **   send DOS command to disk
  7.  *a   auto line numbering or renumbering
  8.  *b   read or write a disk block
  9.  *c   copy a file or entire disk, change a file type, recover scratched file
  10.  *d   delete a range of lines
  11.  *f   show how much free memory
  12.  *g   get disk directory
  13.  *l   show load address of program file
  14.  *m   enable Micromon monitor
  15.  *p   print seqential file
  16.  *q   disable (quit) wedge
  17.  *t   text editor
  18.  *u   un-new a program
  19.  *x   dump screen to printer
  20.  *!   computer cold start (reset)
  21.  *#   change wedge #
  22.  *=   change disk drive # (and wedge #)
  23.  *+   change border color
  24.  *-   change background color
  25.  *\   change character color
  26.  *?   show command menu
  27.  */   load program file
  28.  *@   load program file to header address
  29.  *^   load program file and run it
  30.  *_   save program file
  31.  *:   load seqential file
  32.  *;   save seqential file
  33.  *,   load user file
  34.  *.   save user file
  35.  ------------------------------------------------------------------------------
  36.  The following commands are available when using Micromon (*m)
  37.  
  38.  a    assembler                          b    break set
  39.  c    compare memory                     d    disassembler
  40.  e    disconnect micromon                f    fill memory
  41.  g    go run                             h    hunt memory
  42.  j    jump to subroutine                 l    load memory from device
  43.  m    memory display                     n    new locator
  44.  o    offset or branch calculate         p    printer toggle (serial bus)
  45.  q    quick trace                        r    register display
  46.  s    save memory to device              t    transfer memory
  47.  v    verify memory with device          w    walk through program
  48.  x    exit to basic (brk enabled)        "    ascii conversion
  49.  #    decimal conversion                 $    hex conversion
  50.  %    binary conversion                  &    checksum memory
  51.  (    enable command tone                )    disable command tone
  52.  +    add hex numbers                    -    subtract hex numbers
  53.  >    disk directory
  54.  
  55.  
  56.  Command detail and syntax
  57.  
  58.  I wrote this program with several objectives in mind........ I wanted to be
  59.  able to access a lot of utility programs without having to load them in every
  60.  time I wanted to use one. Also, I did not want it to slow down the running of
  61.  programs, change any of the standard basic commands, nor use up any of the
  62.  basic memory space. I also wanted to be able to use abbreviated DOS commands.
  63.  
  64.  The main wedge routines reside in memory from hex $a001 to $cfff. Any program
  65.  that does not use memory in this range should be able to co-exist. When
  66.  Micromon is in use, the casette buffer is also used. About 2/3 of the memory
  67.  used by the wedge is under the basic and Kernal ROMS. Since the wedge is all
  68.  machine language, basic is not needed to perform any of the wedge commands,
  69.  and is switched out (temporarily) while they are being performed. All wedge
  70.  commands must be preceeded by an asterisk (*). The asterisk tells basic
  71.  (direct mode only) that the command that follows should be turned over to the
  72.  wedge interpreter.
  73.  
  74.  You can load the wedge with the conventional basic statement:
  75.  
  76.  LOAD"WEDGE",8
  77.  
  78.  Next, RUN and the machine code will be transferred to the proper place,
  79.  enabled to communicate with disk drive # 8 (default setting), and the command
  80.  menu will be displayed. The basic part of the program erases itself after the
  81.  wedge is in place.
  82.  ------------------------------------------------------------------------------
  83.  Notes: Unless otherwise noted, any references to numbers can be in decimal or
  84.  hex. If you specify hex, the number must be preceeded by the $ symbol.
  85.  Example ---- 42 (decimal) or $2a (hex)
  86.  
  87.  Commands which write data to buffers in the 64 will not disturb basic
  88.  programs, nor will they overwrite variables or strings. Buffers are allocated
  89.  by the wedge from areas that have not yet been used by your basic programs.
  90.  The wedge finds these areas by reading the vectors at locations 49 through 52.
  91.  @
  92.  ------------------------------------------------------------------------------
  93.  *
  94.  This command alone will read the error channel of the disk drive and print it
  95.  on the screen.
  96.  ------------------------------------------------------------------------------
  97.  **
  98.  Sends any text following the ** to the disk drive as a DOS command. Examples:
  99.  
  100.  **n:diskname,id     ->  formats a disk
  101.  **i                 ->  initializes the drive
  102.  **s:filename        ->  scratches a file
  103.  **v                 ->  validates a disk
  104.  **r:newname=oldname ->  renames a file
  105.  ------------------------------------------------------------------------------
  106.  *a,10               *a,1000,10          *a
  107.  This command can take any of those three forms. The first will enable auto
  108.  line number feeds. After giving the command, you can start the process by
  109.  typing in a basic program line. When you press return, the next line number
  110.  will be waiting for you on the following line, and the cursor will be waiting
  111.  one space to the right of the number. Auto line number feeds will be discon-
  112.  nected automatically when any function is performed other than editing or
  113.  entering program lines. This includes listing or running programs, pokes,
  114.  peeks, etc. (otherwise it would interfere with these functions). The number
  115.  following the comma can be any number from 1 to 63999.
  116.  
  117.  The second form of this command (two numbers) is used to renumber a basic
  118.  program residing in the 64. The first number is the number you want the first
  119.  line to be, and the second is the step size between line numbers.
  120.  
  121.  The third form of this command disconnects auto line number feeds.
  122.  ------------------------------------------------------------------------------
  123.  *br,$20,$2            *bw,$20,$2
  124.  The *br command will read a block of data from the disk, display the location
  125.  of the buffer where the data is stored, and enable Micromon so that you can
  126.  display the data (see Micromon command docs). Since Micromon displays it's
  127.  information in hex, it's usually a good idea to specify hex numbers in the
  128.  block-read and block-write wedge commands (to avoid confusion). The first
  129.  number is the track, the second is the sector (block).
  130.  
  131.  The *bw command will write a block of data from the buffer to a block on the
  132.  disk. This command is usually used after a block-read command, where you have
  133.  modified the data and wish to write it back to the block. This command is
  134.  very powerful. If you goof using it, you can really mess up a disk, so it's a
  135.  good idea to have an extra copy of the disk on hand as insurance. For this
  136.  reason, you will also be prompted to confirm your intent to write to the
  137.  block (makes you think about it one last time).
  138.  ------------------------------------------------------------------------------
  139.  *c:filename         *c:filename,type    *c*                 *c**
  140.  The *c:filename command is used to make copies of single files. The file is
  141.  read into a buffer from the source disk, and you are prompted for another disk
  142.  (must be formatted). Once you have inserted the destination disk, pressing
  143.  RETURN will cause the buffered file to be written to it. For large files, it
  144.  will be necessary to swap the disks until the entire file is copied (you will
  145.  be prompted to do so). Example....*c:wedge will copy the file named "wedge".
  146.  No need to specify file type, as that info is read from the directory.
  147.  
  148.  If you use this command on a file that has been scratched, it will recover the
  149.  file (not copy it). The file will be recovered as a program file unless you
  150.  specify otherwise, as in the following command.
  151.  
  152.  The *c:filename,type command is used to change file types, or to recover
  153.  scratched files as a particular file type. For example, *c:wedge,s will
  154.  change the file named "wedge" to a seqential file, or will recover a
  155.  scratched file named "wedge" as a seqential file. One final note on copying
  156.  single files........relative files are not supported. However, you can copy
  157.  relative files with the next 2 commands.
  158.  
  159.  The *c* command will make a copy of the entire disk. Disks with a lot of data
  160.  on them will need to be swapped a few times (you'll be prompted), and the
  161.  destination disk must already be formatted. All blocks allocated in the BAM
  162.  will be copied. The *c** command will cause all blocks to be copied, whether
  163.  they are allocated in the BAM or not.
  164.  
  165.  
  166.  *d100-400       *d-300         *d200-
  167.  
  168.  Deletes a specified range of program lines. In the first example, all lines
  169.  from 100 to 400 (inclusive) will be deleted. In the second, all from 0 to 300
  170.  and in the third, all from 200 up. This command also performs a CLR.
  171.  
  172.  ------------------------------------------------------------------------------
  173.  *f
  174.  Reads out how much unused memory is left for basic in hex and decimal values.
  175.  ------------------------------------------------------------------------------
  176.  *g
  177.  Prints the directory of the disk to the screen. This command will not disturb
  178.  basic programs like the load"$",8 command does. Pressing the CTRL key will
  179.  slow the display, any other key will stop it and return you to command mode.
  180.  ------------------------------------------------------------------------------
  181.  *l:filename
  182.  Reads out the load address of a program file in hex and decimal
  183.  ------------------------------------------------------------------------------
  184.  *m
  185.  Enables Micromon, a machine language monitor program. Many versions of this
  186.  program exist, so I won't go into a detailed list of the commands and their
  187.  syntax. There is good documentation available in Compute's First Book of
  188.  Commodore 64, though, and the version used in the wedge is very similar. Some
  189.  of the differences are that the wedge version resides under the basic rom from
  190.  $b000 to $bfff, and is supported by several wedge subroutines; the 'p'
  191.  command toggles the printer (device 4) on the serial bus instead of on the
  192.  RS232 port; etc. Not different enough to matter much.
  193.  ------------------------------------------------------------------------------
  194.  *p:filename
  195.  Prints a sequential file to the screen or to a printer (device 4 on the
  196.  serial bus). Pressing the CTRL key while printing to the screen will slow the
  197.  display, any other key will pause. While paused, pressing 'x' will terminate
  198.  the operation, any other key will resume it.
  199.  ------------------------------------------------------------------------------
  200.  *q
  201.  Disables the wedge program. To re-enable it, you must SYS49152.
  202.  ------------------------------------------------------------------------------
  203.  *t
  204.  Enables the text editor...see the additional writeup at the end of this DOC.
  205.  ------------------------------------------------------------------------------
  206.  *u
  207.  Un-new's a program. This command is useful to those of us who accidentially
  208.  type NEW and wish we hadn't. It will recover the program (as long as you
  209.  haven't loaded in another one yet). Also performs a CLR.
  210.  ------------------------------------------------------------------------------
  211.  *x
  212.  Dumps the screen to the printer. The command line is erased just before the
  213.  dump so that you can copy the screen without having *x show up on your
  214.  printout. It's good practice to issue this command from a line other than the
  215.  last (issuing it from the last line will cause the screen to scroll).
  216.  
  217.  This is a fairly simple screen dump utility. It will not support bitmapped
  218.  screens, reverse video will be printed as non-reverse, etc. However, it will
  219.  support upper and lower case characters and CBM graphics characters. It does
  220.  it by reading the register at $d011 prior to opening the printer file. If the
  221.  mode is upper/lower case, a secondary address of 7 is sent to the printer,
  222.  else it sends a zero instead. Tested with the CBM 1525, Prowriter 8510 and the
  223.  Hewlett-Packard "Thinkjet".
  224.  ------------------------------------------------------------------------------
  225.  *!
  226.  Sends the computer to it's cold start routine (same as typing SYS64738)
  227.  ------------------------------------------------------------------------------
  228.  *#9
  229.  Switches the wedge number so that you can communicate with a disk drive of a
  230.  different address (device 9 in this case). You can specify a device number
  231.  from 8 to 31, but you must specify it in decimal (as in the example).
  232.  ------------------------------------------------------------------------------
  233.  *=9
  234.  Changes both the wedge number and the number of the disk drive you are
  235.  currently communicating with. If you are currently dealing with drive 8,
  236.  giving this command will change the drive number to 9 and set the wedge to
  237.  communicate with device 9. Same syntax rules apply as in *# command.
  238.  ------------------------------------------------------------------------------
  239.  *+14                *-14                *\5
  240.  These commands change the border, background and character color respectively.
  241.  *+14 would change the border color to light blue, *-14 changes background to
  242.  light blue, and *\5 will make the text green. Numbers must be specified in
  243.  decimal. You can give these commands without numbers (*+  *-  or  *\). In this
  244.  case, the color will be incremented to the next higher-numbered one.
  245.  ------------------------------------------------------------------------------
  246.  *?
  247.  Displays an abbreviated command menu for quick reference.
  248.  ------------------------------------------------------------------------------
  249.  */filename          *@filename          *^filename          *_filename
  250.  The first example loads a program file the same as load"filename",device. The
  251.  second is the same as load"filename",device,1. However, the basic pointers
  252.  will not be disturbed. This command is usually used to load machine language
  253.  programs, and works the same as the DOS WEDGE command %filename (loads to the
  254.  file header address). The third example will load and then run a program
  255.  (usually used on basic programs). The fourth is used to save a program, as in
  256.  save"filename",device.
  257.  
  258.  In all of these examples (except for *@) you can specify optional addresses
  259.  If you specify addresses for the save command, the syntax must follow this
  260.  form:
  261.  
  262.  *_filename,addr1,addr2
  263.  
  264.  The first address is the start of the save, the second is one byte MORE than
  265.  the last address to be included in the save. Addresses can be hex or decimal.
  266.  
  267.  For the load commands, the syntax is like this:
  268.  
  269.  */filename,addr     *^filename,addr
  270.  
  271.  Specifying a load address will cause the basic pointers to remain untouched,
  272.  will override header addresses and cause the load & run (*^) command to
  273.  default to load only.
  274.  ------------------------------------------------------------------------------
  275.  *:filename          *;filename
  276.  These commands will load and save seqential files, respectively. I use it to
  277.  put files into RAM somewhere (I usually specify an address to load to) so that
  278.  I can examine the data with Micromon. Once in RAM, the data can be modified
  279.  and written back, ignored, whatever. Addresses are optional here, too.
  280.  ------------------------------------------------------------------------------
  281.  *,filename          *.filename
  282.  Load and save user files, repectively. Addresses optional.
  283.  ------------------------------------------------------------------------------
  284.  NOTE: On any of the load/save/copy i/o commands, you can abort reading or
  285.  writing with the STOP key. Pressing this key during these i/o operations will
  286.  close all files and return you to the basic command level.
  287.  ------------------------------------------------------------------------------
  288.  TEXT EDITOR (*t) see the next doc file
  289.